<?php

require_once dirname(__FILE__).'/../lib/userGeneratorConfiguration.class.php';
require_once dirname(__FILE__).'/../lib/userGeneratorHelper.class.php';

/**
 * user actions.
 *
 * @package    xists
 * @subpackage user
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 12474 2008-10-31 10:41:27Z fabien $
 */
class userActions extends autoUserActions
{
  
  public function executeBatchActivate(sfWebRequest $request)
  {
    $ids = $request->getParameter('ids');
 
    $xistsUsers = XistsUserPeer::retrieveByPks($ids);
 
    foreach ($xistsUsers as $xistsUser) {
      $xistsUser->activate(1);
    }
 
    $this->getUser()->setFlash('notice', 'The selected Users have been activated successfully.');
    
    $this->redirect('@xists_user');
 
  }
  
  public function executeBatchDeactivate(sfWebRequest $request)
  {
    $ids = $request->getParameter('ids');
 
    $xistsUsers = XistsUserPeer::retrieveByPks($ids);
 
    foreach ($xistsUsers as $xistsUser) {
      $xistsUser->activate(0);
    }
 
    $this->getUser()->setFlash('notice', 'The selected Users have been Deactivated successfully.');
 
    $this->redirect('@xists_user');
    
  }
  
}
